Cube.define('Cube.core.Base', {
	constructor: function() {},
	
	/**
	 * Helper method to parse a config object. The first argument is the config object iself, while the second argument
	 * are the default options for that config object. If a property of the config object is undefined, it will use the
	 * one from the defaults object.
	 * 
	 * 	var defaults = {
	 * 		name: "Default name",
	 * 		age: 18,
	 * 		gender: "Male"
	 * 	};
	 * 
	 * 	var options = {};	
	 * 
	 * 	options = this.parseConfig(options, defaults);
	 * 
	 * Options will now contain all the properties from the defaults object.
	 *  
 	 * @param {Object} options
 	 * @param {Object} defaults
 	 * @return {Object}
	 */
	parseConfig: function(options, defaults) {		
		Cube.each(defaults, function(value, index) {
			if (typeof(options[index]) === "undefined")
			{
				options[index] = value;
			}
		});
		
		return options;
	},
	
	parseOptions: function(config, object) {
		for (i in config)
		{
			object[i] = config[i];
		}
	}
});
